var orderId;
var memberId;
var teacherId;
//去追问闪测问题页面
function quickAskHistory(orderId) {
    if(server.isEmpty(orderId)){
        pop_up("获取订单ID失败，请联系管理员");
        return;
    }
    server.loadindex('page/quickask/memberhistoryQuickAsk/memberhistoryQuickAsk','orderId='+orderId,true);
}
function reask_submit(awnerSide){
    var formdata = $("#memberhistoryQuickAsk_frm_main").serializeObject();
    if(server.isEmpty(orderId)){
        pop_up("获取订单ID失败，不能提交");
        return;
    }
    console.log(formdata);
    var submitdata = {};
    submitdata.orderId=orderId;
    submitdata.memberId=memberId;
    submitdata.teacherId=teacherId;
    submitdata.awnserSide=awnerSide;
    submitdata.startDate = new Date().format("yyyy-MM-dd hh:mm:ss");
    submitdata.endDate = new Date().format("yyyy-MM-dd hh:mm:ss");
    submitdata.content = formdata.replycontent;
    submitdata.businessType=1;

    $("#submitbtn").removeAttr('onclick');

    server.req('wechat/orderawnser/reask',submitdata,function (res) {
       console.log(res);
       if(res.code==0){
           pop_up("提交成功");
       }else{
           pop_up(res.msg);
       }

        quickAskHistory(orderId)
    },null,"POST");
};
function cancel(){
    server.loadindex('page/order/orderlist/orderlist');
}
$(function () {
    orderId = server.getQueryString("orderId");
    if(server.isEmpty(orderId)){
        pop_up("获取订单ID失败，请联系管理员");
        return;
    }
    memberId = server.getQueryString("memberId");
    if(server.isEmpty(memberId)){
        pop_up("获取会员ID失败，请联系管理员");
        return;
    }
    teacherId = server.getQueryString("teacherId");
    if(server.isEmpty(teacherId)){
        pop_up("获取专家ID失败，请联系管理员");
        return;
    }
})